import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpFormData {
  id!: number;
  type: number = 1;
  orderId: number = 0;
  data!: unknown;
  time!: string;
  userId!: number;
  uniacid!: number;
  formId: number = 0;
}

export const ImsYzdKpFormDataSchema = new EntitySchema({
  class: ImsYzdKpFormData,
  properties: {
    id: { primary: true, type: 'number' },
    type: { type: 'number', default: 1, index: 'type' },
    orderId: { type: 'number', default: 0, index: 'order_id' },
    data: { type: 'unknown', columnType: 'longtext' },
    time: { type: 'string', length: 255 },
    userId: { type: 'number', index: 'user_id' },
    uniacid: { type: 'number', index: 'uniacid' },
    formId: { type: 'number', default: 0, index: 'form_id' },
  },
});
